home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol F-12
/
(Vol F-12) Jun 02 2012.iso
/
Screensaver
/
screensaver_installer.exe
/
____swmx
/
scripts
/
frame_1
/
DoAction_15.as
< prev
next >
Wrap
Text File
|
2004-10-21
|
2KB
|
74 lines
_global.ScreenweaverMenu = function()
{
this.init();
};
ScreenweaverMenu.prototype.init = function()
{
ASBroadcaster.initialize(this);
};
ScreenweaverMenu.prototype.registerMenu = function(menuData, userCallback, scope)
{
this.__parseMenuData.callback = callback;
delete this.__parseMenuData.result;
callback = function(s, i)
{
if(!s)
{
return undefined;
}
us = arguments.callee;
if(us.menus[us.counter].parent)
{
us.menus[us.counter].parent.submenu = i;
}
us.counter = us.counter + 1;
if(us.counter < us.menus.length)
{
swInterface.callMethod("createCustomPopup",us.menus[us.counter],us);
}
else
{
us.userCallback.apply(us.userScope,[s,i]);
}
};
callback.menus = this.__parseMenuData(menuData);
callback.counter = 0;
callback.userCallback = userCallback;
callback.userScope = scope;
swInterface.callMethod("createCustomPopup",callback.menus[0],callback);
};
ScreenweaverMenu.prototype.__parseMenuData = function(menuData, parent)
{
if(!arguments.callee.result)
{
arguments.callee.result = [];
}
var thisMenu = [];
thisMenu.parent = parent;
var i = 0;
while(i < menuData.length)
{
var thisItem = {caption:menuData[i].caption,callbackID:(typeof menuData[i].callback ne "function" ? menuData[i].callback : swInterface.addCallback(menuData[i].callback,true,menuData[i].scope)),scope:menuData[i].scope,submenu:0};
if(menuData[i].submenu)
{
arguments.callee.apply(this,[menuData[i].subMenu,thisItem]);
}
thisMenu.push(thisItem);
i++;
}
arguments.callee.result.push(thisMenu);
return arguments.callee.result;
};
ScreenweaverMenu.prototype.setWindowMenu = function(menuId)
{
getURL("FSCommand:sw_selectWindowMenu",menuId);
};
ScreenweaverMenu.prototype.setPopupMenu = function(menuId)
{
getURL("FSCommand:sw_selectCustomPopup",menuId);
};
ScreenweaverMenu.prototype.showPopupMenu = function(menuId)
{
getURL("FSCommand:sw_showCustomPopup",menuId);
};